#ifndef _CALC_STACK_H_
#define _CALC_STACK_H_

#include "CALC_Item.h"

typedef struct tagCalcStack {
  unsigned int uiItemNum;     /* the item count now */
  unsigned int uiItemNumMax;  /* the max item count */
  CALC_ITEM_S *pstStack;      /* the pointer to the top of the stack */
}CALC_STACK_S;

int Calc_StackInit(IN unsigned int uiItemNumMax,
                   OUT CALC_STACK_S *pstStack);

int Calc_IsStackEmpty(IN CALC_STACK_S *pstStack);

int Calc_StackPush(IN CALC_STACK_S *pstStack,
                   IN CALC_ITEM_S *pstItem);

int Calc_StackPop(IN CALC_STACK_S *pstStack,
                  OUT CALC_ITEM_S *pstItem);

void Calc_StackDestroy(IN CALC_STACK_S *pstStack);

unsigned int Calc_StackGetItemCount(IN CALC_STACK_S *pstStack);

#endif
